package Kuang;

/**
 * description:
 * author:zcx
 * lenovo
 * 时间：2022.02.09.19.19
 */
public class Demo11 {
    public static void main(String[] args) {
        System.out.println(Thread.currentThread().getName()+"-->"+Thread.currentThread().getPriority());
        var my=new Myp();
        var t1=new Thread(my);
        var t2=new Thread(my);
        var t3=new Thread(my);
        var t4=new Thread(my);
        var t5=new Thread(my);
        //先设置优先级
        t1.start();
        t2.setPriority(1);
        t3.setPriority(4);
        t4.setPriority(8);
        t5.setPriority(Thread.MAX_PRIORITY);
        t2.start();
        t3.start();
        t4.start();
        t5.start();

    }
}
class Myp implements Runnable{
    @Override
    public void run() {
        System.out.println(Thread.currentThread().getName()+"-->"+Thread.currentThread().getPriority());
    }
}

